<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/shippingRequest.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();try{%>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/assembly_release.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/quickSearch.js"></script>

<SCRIPT language="JavaScript">
window.onload=init;

function init()
{
    qs_1 = new QuickSearch(document.shippingRequestNewForm['shippingRequest.processStepId'], document.shippingRequestNewForm.qs1, false);
}

function newTransfer()
{
    var errors = "";

    if( document.shippingRequestNewForm['shippingRequest.processStepId'].value == -1 )
    {
        errors = "<li>Select the Part Number";
    }
    if( document.shippingRequestNewForm['shippingRequest.fromLocationId'].value == -1 )
    {
        errors = errors + "<li>Select the Class Store Vendor";
    }
    if( document.shippingRequestNewForm['shippingRequest.shipTolocationId'].value == -1 )
    {
        errors = errors + "<li>Select the ShipTo Vendor";
    }

    if( errors != "" )
    {
        var pa = document.getElementById("errors");
        pa.innerHTML = errors;
        return false;
    }

    document.shippingRequestNewForm.action = '<%=chipTracContext%>/shippingRequest.do?action=create';
    document.shippingRequestNewForm.submit();

}

function reset()
{
    document.shippingRequestNewForm.reset();
    qs_1.resetQuickSearchCntrl();
}

</SCRIPT>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
	<TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

	<!-- Side Navigation start -->
	<%@ include file="/jsp/operations/dataentryMenu.jsp" %></TD>
	<!-- end of the side navigations -->

	<TD bgcolor="#ffffff">
	<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
	<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
	<TD valign="top" width="100%">

	<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
	<BR>

	<html:form action="/shippingRequest.do" name="shippingRequestNewForm" method="POST" type="com.scalar.chiptrack.operations.shippingRequest.forms.ShippingRequestForm">
        <nested:nest property="shippingRequest" >
    	<TABLE width="70%" align="center" cellpadding="2" cellspacing="2" border="0">
			<TR><TD colspan="4" class="NArialW" align="center">Ship Request</TD></TR>

			<TR><TD colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></TD></TR>
			<TR><TD colspan='4' class="NArialL"><chiptrack:errors styleClass="NArialL"/></TD></TR>
			<TR><TD colspan='4' class="NArialL"><chiptrack:info styleClass="NArialL"/></TD></TR>
			<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <tr>
            <td class="NArialL" nowrap>
            Quick Search Part Number:
            </td>
            <td class="NArialL">
            <input type="text" name="qs1" class="txfield" size='18' onkeyup='quickSearch(qs_1)'/>
            </td>
            <td colspan='2'>
            </tr>

            <tr>
			<td class="NArialL" width="20%" nowrap>
				Part Number:
			</td>
			<td class="NArialL" width="30%">
			<nested:select property="processStepId"  styleClass="txfield">
                <html:option value="-1">All Part Numbers</html:option>
				<html:options collection="partNumberList" property="value" labelProperty="label"/>
			</nested:select>
			</td>
			<td class="NArialL" width="20%" nowrap>
				Class Store Vendor:
			</td>
			<td class="NArialL" width="30%">
			<nested:select property="fromLocationId"  styleClass="txfield">
                <html:option value="-1">All Class Store Vendors</html:option>
				<html:options collection="vendorList" property="value" labelProperty="label"/>
			</nested:select>
			</td>
			</tr>
            <tr>
			<td class="NArialL" width="20%" nowrap>
				Ship To Vendor
			</td>
			<td class="NArialL" width="30%">
			<nested:select property="shipTolocationId"  styleClass="txfield">
                <html:option value="-1">All Ship To Vendors</html:option>
				<html:options collection="shipToLocationList" property="value" labelProperty="label"/>
			</nested:select>
			</td>
            <td class="NArialL" width="20%" nowrap> &nbsp; </td>
            <td class="NArialL" width="30%"> &nbsp; </td>
            </tr>
			<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
			<tr>
				<td colspan="5" align="center">
                <input type=image border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" onClick ="javascript:return newTransfer();" width="53" height="17" onmouseover="window.status='Click to Search for Class Store Lots';return true" onmouseout="window.status='';return true" title="Click here to Search for Class Store lots"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="javascript:reset()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
				</td>
			</tr>
            <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
       	</TABLE>
    </nested:nest>
	</html:form>
<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>
<%}catch(Exception e ){e.printStackTrace();}%>